Obstructive sleep apnea (OSA) is a highly prevalent condition in patients with coronary heart disease and is associated with impaired exercise performance, functional limitation and reduced health-related quality of life. We hypothesize that identification and treatment of OSA in patients undergoing cardiac rehabilitation will improve the response to rehabilitation. The proposed study will test this hypothesis using a parallel- group, randomized, clinical trial comparing OSA treatment with continuous positive airway pressure (CPAP) to an educational control group in patients undergoing cardiac rehabilitation who screen positive for previously undiagnosed OSA. Subjects will be Veterans who have been referred for cardiac rehabilitation at the VA Boston Healthcare System. All consenting male or female patients referred for cardiac rehabilitation will undergo home sleep testing for OSA, and those with moderate to severe OSA (AHI >15) will continue into the clinical trial, unless they have dangerous levels of sleepiness (Epworth Sleepiness Scale score >16 or a report of falling asleep at the wheel of a car within the past 2 years). Subjects will be randomized to treatment with CPAP or to treatment with a healthy lifestyle and sleep education control. Treatment will be continued through the completion of a 12-week, 3-session per week supervised cardiac rehabilitation program. Outcome measures will be made at baseline and repeated at the end of the 12-week program. The primary outcome will be peak O2 consumption on symptom-limited cardiopulmonary exercise testing, with secondary measures of ventilatory efficiency and anaerobic threshold, 6-minute walk distance, World Health Organization Disability Assessment Scale II, and Medical Outcomes Study SF36 Quality of Life Questionnaire. We will screen up to 150 patients referred for cardiac rehabilitation, in order to identify 50 patients with moderate to severe OSA for randomization. This sample size will provide 80% power to detect a 2.5 ml/min/kg absolute difference in peak O2 consumption, the mean of the effect reported in two previous studies of exercise in OSA independent of cardiac rehabilitation, assuming a SD of change in peak O2 consumption of 3.6 ml/min/kg.